<template>
  <div class="home-container">
    <el-card class="welcome-card">
      <template #header>
        <div class="card-header">
          <span>欢迎使用大事件-文章管理系统</span>
        </div>
      </template>
      <div class="welcome-content">
        <h2>📊 系统概览</h2>
        <div class="overview-stats">
          <el-card class="stat-card" shadow="hover">
            <div class="stat-content">
              <div class="stat-number">128</div>
              <div class="stat-label">文章总数</div>
            </div>
          </el-card>
          <el-card class="stat-card" shadow="hover">
            <div class="stat-content">
              <div class="stat-number">18</div>
              <div class="stat-label">分类数量</div>
            </div>
          </el-card>
          <el-card class="stat-card" shadow="hover">
            <div class="stat-content">
              <div class="stat-number">5.2k</div>
              <div class="stat-label">总浏览量</div>
            </div>
          </el-card>
          <el-card class="stat-card" shadow="hover">
            <div class="stat-content">
              <div class="stat-number">36</div>
              <div class="stat-label">今日新增</div>
            </div>
          </el-card>
        </div>
        
        <h2>📝 最近活动</h2>
        <el-timeline>
          <el-timeline-item>
            <el-card>
              <h4>文章发布成功</h4>
              <p>《Vue3 性能优化技巧》已发布</p>
              <span class="time-text">2024-01-15 14:30</span>
            </el-card>
          </el-timeline-item>
          <el-timeline-item>
            <el-card>
              <h4>分类更新</h4>
              <p>新增分类：前端框架</p>
              <span class="time-text">2024-01-14 10:15</span>
            </el-card>
          </el-timeline-item>
          <el-timeline-item>
            <el-card>
              <h4>系统维护</h4>
              <p>系统已完成安全更新</p>
              <span class="time-text">2024-01-12 03:00</span>
            </el-card>
          </el-timeline-item>
        </el-timeline>
      </div>
    </el-card>
  </div>
</template>

<script setup>
import { ElCard, ElTimeline, ElTimelineItem } from 'element-plus'
</script>

<style scoped>
.home-container {
  /* padding: 20px; */
  height: 100%;
  overflow-y: auto;
}
.card-header{
  font-size: 30px;
  font-weight: bold;
}
.welcome-card {
  height: 100%;
}

.welcome-content h2 {
  margin: 20px 0 15px 0;
  color: #303133;
  font-size: 18px;
}

.overview-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-content {
  text-align: center;
  padding: 20px;
}

.stat-number {
  font-size: 32px;
  font-weight: bold;
  color: #409eff;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 14px;
  color: #606266;
}

.el-timeline {
  margin-top: 10px;
}

.el-timeline-item {
  margin-bottom: 20px;
}

.el-timeline-item .el-card {
  transition: all 0.3s ease;
}

.el-timeline-item .el-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.el-timeline-item .el-card h4 {
  margin: 0 0 10px 0;
  color: #303133;
}

.el-timeline-item .el-card p {
  margin: 0 0 10px 0;
  color: #606266;
}

.time-text {
  font-size: 12px;
  color: #909399;
}
</style>